package oop.java0329.work1;

/**
 * 定义全能飞行员类，可以开客机，也可以开战斗机
 * 客机有座位数，自重，飞行高度等属性
 * 战斗机有弹头数，自重，飞行高度等属性。
 * <p>
 * 父类：
 */
public class Plane {
    private double weight;//载重
    private double height;//高度

    public Plane() {
    }

    public Plane(double weight, double height) {
        this.weight = weight;
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public void fly() {
        System.out.println("起飞");
    }

    public void speed() {
        System.out.println("加速");
    }

    public void down() {
        System.out.println("降落");
    }

    public void showInfo() {
        System.out.println("飞机信息\n载重：" + weight + "\n飞行高度：" + height);

    }

}
